<%@ page contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="ui" uri="http://egovframework.gov/ctl/ui"%>
<jsp:include page="../include/header.jsp" />
<script type="text/javaScript">
<!--
	function viewPage(id) {
		$('#sau_user_id').val(id);
		$('#listForm').attr('action', '<c:url value="/user/userView.do"/>');
		$('#listForm').submit();		
	}

	function writeFormPage() {
		$('#listForm').attr('action', '<c:url value="/user/userWriteForm.do"/>');
		$('#listForm').submit();
	}

	/* pagination 페이지 링크 function */
	function paging(pageNo){
		$('#pageIndex').val(pageNo);
		$('#listForm').attr('action', '<c:url value="/user/userList.do"/>');
		$('#listForm').submit();
	}
	
	function searchForm(){
		$('#pageIndex').val('1');
		$('#listForm').attr('action', '<c:url value="/user/userList.do"/>');
		$('#listForm').submit();
	}

-->
</script>
<!-- contents s -->
<div class="container" id="container">
	<span class="round lt">&nbsp;</span>
	<span class="round rt">&nbsp;</span>
	<span class="round lb">&nbsp;</span>
	<span class="round rb">&nbsp;</span>
	<div class="container_area">
	<form name="listForm" id="listForm" method="post" action="<c:url value='/user/userList.do'/>">
		<input type="hidden" name="pageIndex" id="pageIndex" value="${userVO.pageIndex }"/>
		<input type="hidden" name="sau_user_id" id="sau_user_id" />
		<h2 class="tit_h2">담당자관리 목록</h2>
			<jsp:include page="../include/navi.jsp" />
			<div class="srch_wrap">
				<fieldset>
					<legend>키워드 검색 조회 영역</legend>
					<select id="searchType" name="searchType" title="검색키워드를 선택하세요">
						<option value="NAME" <c:if test="${userVO.searchType eq 'NAME'}">selected="selected"</c:if>>성명</option>
						<option value="EMAIL" <c:if test="${userVO.searchType eq 'EMAIL'}">selected="selected"</c:if>>이메일</option>
					</select>
					<input type="text" title="검색영역" id="searchKeyword" name="searchKeyword" class="input_srch" value="${userVO.searchKeyword }"/>
					<a href="<c:url value='/user/userList.do'/>" onclick="searchForm();return false;" class="btn_srch">검색</a>
				</fieldset>
			</div>
			<div class="table_wrap"><!-- D : table은 div table_wrap 싸고감 -->
				<table summary="담당자 관리 목록 입니다" class="table_list">
					<caption>담당자 관리</caption>
					<colgroup> <!-- D : col width로 테이블 넓이 조절 -->
						<col width="10%" />
                           <col width="15%" />
                           <col width="25%" />
                           <col width="25%" />
                           <col width="15%" />
                           <col width="10%" />
					</colgroup>
					<thead>
						<tr>
							<th scope="col">번호</th>
                               <th scope="col">성명</th>
                               <th scope="col">연락처</th>
                               <th scope="col">이메일</th>
                               <th scope="col">등록일</th>
                               <th scope="col">상태</th>
						</tr>
					</thead>
					<tbody>
					<c:forEach var="result" items="${resultList}" varStatus="status">
					<tr>
						<td><c:out value="${(userVO.rowNum)-(status.count-1)}"/></td>
						<td><a href="<c:url value="/user/userView.do"/>?sau_user_id=${result.sau_user_id}" onclick="viewPage('${result.sau_user_id}');return false;" class="link"><c:out value="${result.sau_user_name}"/></a></td>
						<td><c:out value="${result.sau_user_hp}"/>&nbsp;</td>
						<td><c:out value="${result.sau_user_email}"/>&nbsp;</td>
						<td><c:out value="${result.sau_regi_date}"/>&nbsp;</td>
						<td>
							<c:if test="${result.sau_flag_yn eq 'Y'}">사용</c:if>
							<c:if test="${result.sau_flag_yn eq 'N'}">삭제</c:if>
						</td>
					</tr>
					</c:forEach>
					</tbody>
				</table>
			</div><!--//table_wrap-->
			<div class="paging">
				<ui:pagination paginationInfo="${userVO}" type="image" jsFunction="paging" />
			</div>
			<div class="btn_bbs">
				<a href="<c:url value="/user/userWriteForm.do"/>" onclick="writeFormPage(); return false;" class="btn_write">담당자 등록</a>
			</div>
		</form>
	</div><!--//container_area-->
</div>
<!-- contents e -->
<jsp:include page="../include/footer.jsp" />